#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QStandardItemModel>
#include <QStandardItem>
#include <QTableView>
#include "adddialog.h"
#include <QAbstractItemView>
#include <QAbstractItemView>
#include <QList>
#include "student.h"
#include "studentservice.h"
#include <QDebug>
#include <QInputDialog>
#include <QMessageBox>
#include <QString>

#include <agespinboxdelegate.h>

QT_BEGIN_NAMESPACE
namespace Ui { class MainWindow; }
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

    void delRow();


private slots:
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
    void on_pushButton_3_clicked();
    void clicked_rightMenu(const QPoint &pos);  //右键信号槽函数
    void deletefunc();



private:
    Ui::MainWindow *ui;
    AddDialog *ad;
    QTableView *tbv;
//    AgeSpinBoxDelegate *ageDelegate;


    StudentService stuSer;


    void initModel1(QStandardItemModel* model);


    QTableView *tableview;
    QMenu *rightMenu;  //右键菜单
    QAction *cutAction;  //剪切
    QAction *copyAction;  //复制
    QAction *pasteAction;  //粘贴
    QAction *deleteAction;  //删除


};

#endif // MAINWINDOW_H
